/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author sqc
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '/@/api/model/baseModel';

const { adminPath } = useGlobSetting();

export interface JbSupplier extends BasicModel<JbSupplier> {
  supplierId?: string; // supplier_id
  supplierName?: string; // 供应商名称
  contactsName?: string; // 供应商联系人姓名
  contactsMobile?: string; // 供应商联系人电话
  supplierAddress?: string; // 供应商地址
  legalPerson?: string; // 供应商法人
  supplierLogo?: string; // 供应商LOGO路径
  creditCode?: string; // 统一信用代码
  shortName?: string; // 报价单显示的简称
  pinyinCode?: string; // 简称的拼音首字母，用于快速搜索
  createByName?: string; // 创建者姓名
  updateByName?: string; // 更新者姓名
}

export const jbSupplierList = (params?: JbSupplier | any) =>
  defHttp.get<JbSupplier>({ url: adminPath + '/quotation/jbSupplier/list', params });

export const jbSupplierListData = (params?: JbSupplier | any) =>
  defHttp.post<Page<JbSupplier>>({ url: adminPath + '/quotation/jbSupplier/listData', params });

export const jbSupplierForm = (params?: JbSupplier | any) =>
  defHttp.get<JbSupplier>({ url: adminPath + '/quotation/jbSupplier/form', params });

export const jbSupplierSave = (params?: any, data?: JbSupplier | any) =>
  defHttp.postJson<JbSupplier>({ url: adminPath + '/quotation/jbSupplier/save', params, data });

export const jbSupplierDelete = (params?: JbSupplier | any) =>
  defHttp.get<JbSupplier>({ url: adminPath + '/quotation/jbSupplier/delete', params });
